﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Public/Public.Master" AutoEventWireup="true" CodeBehind="Category.aspx.cs" Inherits="NhanAi.Public.Category" %>

<%@ Register Src="~/Public/PublicPagingBar.ascx" TagName="PagingBar" TagPrefix="uc" %>
<%@ Import Namespace="NhanAi.Entity" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>
        <asp:Literal ID="litCount" runat="server" Text="<%$Resources:HmLanguage,subject %>"></asp:Literal></title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <% string lang = CurrentLanguage; %>
    <%if (Taxonomy != null)
      { %>
    <h2 class="category-title">
        <asp:Literal runat="server" ID="litSubject" Text="<%$Resources: HmLanguage, subject %>"></asp:Literal>
        : <%= lang=="vi"?Taxonomy.TermName:Taxonomy.TermNameEn %></h2>
    <%} %>
    <%if (Taxonomies != null && Taxonomies.Count > 0)
      { %>
    <ul>
        <%foreach (Taxonomy t in Taxonomies)
          { %>
        <li><a href="Category.aspx?cate=<%=t.Id %>"><%= lang=="vi"?t.TermName:t.TermNameEn %></a></li>
        <% } %>
    </ul>
    <% } %>
    <%if (Posts != null && Posts.Count > 0)
      {
          foreach (Post p in Posts)
          { %>
    <div class="cate-post-item">
        <img src="<%=p.Guid%>" class="post-thumbnail list-post-image left" />
        <h3 class="list-post-title"><a href="Post.aspx?id=<%=p.Id %>&cate=<%=Taxonomy!=null?Taxonomy.Id.ToString():"" %>"><%=lang == "vi" ? p.Title : p.TitleEn%></a></h3>
        <p class="list-post-excerpt">
            <%= lang == "vi" ? p.Excerpt : p.ExcerptEn%>
            <a href="Post.aspx?id=<%=p.Id %>&cate=<%=Taxonomy!=null?Taxonomy.Id.ToString():"" %>">
                <asp:Literal runat="server" ID="litItem" Text="<%$Resources:HmLanguage, view_more %>"></asp:Literal></a>
        </p>
    </div>
    <%} %>
    <uc:PagingBar runat="server" ID="paging" />
    <% }
      else
      {
          if (Taxonomy != null)
          {%>
    <h3>
        <asp:Literal runat="server" ID="litMessage" Text="<%$Resources:HmLanguage,no_post_of_subject %>"></asp:Literal></h3>
    <% }
      }%>
</asp:Content>
